/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * VistaListado.java
 *
 * Created on 08/04/2011, 09:20:54 AM
 */

package vistas;

import java.awt.event.ActionListener;
import java.util.Vector;
import javax.swing.JButton;
import javax.swing.JTable;
import javax.swing.table.DefaultTableColumnModel;
import javax.swing.table.DefaultTableModel;
import modelos.ModeloIngrediente;

/**
 *
 * @author usuario
 */
public class VistaListado extends javax.swing.JFrame {
    private controladores.ControladorListado control;
    private Vector<String> fila;

    /** Creates new form VistaListado */
    public VistaListado() {
        initComponents();        
        control = new controladores.ControladorListado(this);

    }
     public void addListener(ActionListener escuchador){
        ingrediente.addActionListener(escuchador);
        mas.addActionListener(escuchador);
        salir.addActionListener(escuchador);
        cancelar.addActionListener(escuchador);
        productos.addActionListener(escuchador);
    }

    public JButton getCancelar() {
        return cancelar;
    }

    public JButton getIngrediente() {
        return ingrediente;
    }

    public JButton getMas() {
        return mas;
    }

    public JButton getProductos() {
        return productos;
    }

    public JTable getTblGeneral() {
        return tblGeneral;
    }


    



    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane2 = new javax.swing.JScrollPane();
        tblGeneral = new javax.swing.JTable();
        cancelar = new javax.swing.JButton();
        salir = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        ingrediente = new javax.swing.JButton();
        productos = new javax.swing.JButton();
        mas = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(null);

        tblGeneral.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane2.setViewportView(tblGeneral);

        getContentPane().add(jScrollPane2);
        jScrollPane2.setBounds(20, 190, 720, 250);

        cancelar.setFont(new java.awt.Font("Arial Black", 1, 15)); // NOI18N
        cancelar.setText("Cancelar");
        getContentPane().add(cancelar);
        cancelar.setBounds(250, 480, 120, 30);

        salir.setFont(new java.awt.Font("Arial Black", 1, 15)); // NOI18N
        salir.setText("Salir");
        getContentPane().add(salir);
        salir.setBounds(410, 480, 120, 30);

        jPanel1.setBorder(new javax.swing.border.MatteBorder(null));
        getContentPane().add(jPanel1);
        jPanel1.setBounds(200, -280, 360, 110);

        jPanel2.setBorder(new javax.swing.border.MatteBorder(null));
        jPanel2.setLayout(null);

        ingrediente.setFont(new java.awt.Font("Arial Black", 1, 15)); // NOI18N
        ingrediente.setText("Ingredientes");
        jPanel2.add(ingrediente);
        ingrediente.setBounds(60, 10, 330, 34);

        productos.setFont(new java.awt.Font("Arial Black", 1, 15)); // NOI18N
        productos.setText("Productos");
        jPanel2.add(productos);
        productos.setBounds(60, 60, 330, 34);

        mas.setFont(new java.awt.Font("Arial Black", 1, 15)); // NOI18N
        mas.setText("Ingredientes Mas Vendidos");
        jPanel2.add(mas);
        mas.setBounds(60, 110, 330, 34);

        getContentPane().add(jPanel2);
        jPanel2.setBounds(160, 40, 450, 150);

        jLabel1.setFont(new java.awt.Font("Arial Black", 0, 15)); // NOI18N
        jLabel1.setText("Selecione El Listado que Desea Consultar");
        getContentPane().add(jLabel1);
        jLabel1.setBounds(210, 10, 390, 22);

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-764)/2, (screenSize.height-557)/2, 764, 557);
    }// </editor-fold>//GEN-END:initComponents

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new VistaListado().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton cancelar;
    private javax.swing.JButton ingrediente;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JButton mas;
    private javax.swing.JButton productos;
    private javax.swing.JButton salir;
    private javax.swing.JTable tblGeneral;
    // End of variables declaration//GEN-END:variables

}
